(ns utilities.prompt
(:gen-class))
(import '(javax.swing JFrame JButton JLabel)
	'(java.awt.event ActionListener)
	'(java.awt BorderLayout Dimension))

(defn prompt
	"Displays a warning."
	[]
	(let [frame (JFrame. "Warning")
		ok (JButton. "OK")
		label (JLabel. "Warning your database is not updated... Click on the Refresh Database button" JLabel/CENTER)
		counter (atom 0)
		handler (proxy [ActionListener][]
				(actionPerformed [event]
			(.dispose frame)))]
		(.setDefaultCloseOperation frame JFrame/EXIT_ON_CLOSE)
		(.add frame BorderLayout/CENTER ok)
		(.setPreferredSize label (Dimension. 500 50))
		(.add frame BorderLayout/NORTH label)
		(.addActionListener ok handler)
		(.pack frame)
		(.setVisible frame true)
		))
